from Wzx.wzx9_24.A3mall_po import Page
from selenium.webdriver.common.by import By


class Page2(Page):
    #1点击积分商城 /html/body/div[3]/div[2]/ul/li[6]/a
    jifen_loc = (By.XPATH,'/html/body/div[3]/div[2]/ul/li[6]/a')
    def jifen(self):
        self.click(self.jifen_loc)
    #断言 积分商城 /html/body/div[4]/a[2]
    dy3_loc = (By.XPATH,'/html/body/div[4]/a[2]')
    def dy3(self):
        return self.text(self.dy3_loc)
    #2.点击小坦克 /html/body/div[5]/div[2]/div[2]/div[1]/ul/li[1]/div[1]/span/a
    xtk_loc = (By.XPATH, '/html/body/div[5]/div[2]/div[2]/div[1]/ul/li[1]/div[1]/span/a')
    def xtk(self):
        self.click(self.xtk_loc)
    #断言 小坦克 //*[@id="goodsForm"]/div/div[1]/span
    dy4_loc = (By.XPATH, '//*[@id="goodsForm"]/div/div[1]/span')
    def dy4(self):
        return self.text(self.dy4_loc)
    #3. 点击立即兑换 id="buy-cart"
    dh_loc = (By.ID, 'buy-cart')
    def dh(self):
        self.click(self.dh_loc)

    def test_A3mall_jf_002(self):
        self.luoji_A3mall()
        self.jifen()
        print(self.dy3())
        self.xtk()
        print(self.dy4())
        self.dh()
